A \special
command can appear almost anywhere in an input file.
It behaves like an invisible box of zero height and width.
TEX simply stores the given information in the DVI file at the current
page position.
When previewing a DVI file, draws a small marker indicating the
location of a \special
.
The ``Page Info'' item will display this location in paper coordinates
as well as the text of the \special
command.
allows the inclusion of three common types of Macintosh
graphic files:
- PICT files can be generated by almost all drawing/painting programs
on the Macintosh. A quick way to get a PICT file if you're using System 7
is to type Shift-Command-3.
To include a PICT file, use a command of the form:
\special{pict=filename}
Note that converts the PICT file into a black and white bitmap
for previewing and printing, so you won't see any colors.
The bitmap is always at 72 dpi when previewing, but the current
printing resolution is used when printing.
- PNTG files are also very common — they're better known as MacPaint files.
(Shift-Command-3 on a Mac running System 6 or earlier will create a screen
dump in a file of type PNTG. If you have a color monitor you'll
first need to set it to black and white.)
To include a PNTG file, use a command of the form:
\special{pntg=filename}
- EPSF files are becoming increasingly common.
They contain encapsulated PostScript code in the data fork which uses
when PostScript printing, and a corresponding PICT resource (ID = 256)
which uses when previewing or non-PostScript printing.
To include an EPSF file, use a command of the form:
\special{epsf=filename}
Keywords and file names are case insensitive
and spaces before the file name are ignored.
For example, \special{EPSF=FOO}
is the same as \special{epsf= foo}
.
To find a given \special
file, uses the same search strategy as
that for a TEX input file. It looks in the current folder first, and then in
the input_folders
list.
The file name can also be a path name relative to the current folder, or a full
path name. For example,
\special{pict=:my-pict-files:foo}
will include a file called foo
from a subfolder called my-pict-files
in the current folder.
Spaces and other special characters (like =
) can be included in a file
name or path name by enclosing them in double quotes. For example,
\special{pict="my pict file"}
will include a file called my pict file
.
Using spaces and other unusual characters in a file name is not recommended,
particularly if TEX's \input
command might be used to read the file
(as in the boxedeps.tex
and epsf.tex
macros).
Also avoid using double quotes in a file name.
The PICT/PNTG/EPSF \special
commands all allow you to preview graphics
in your DVI file, but if you have a choice, use EPSF files because:
- The output on a PostScript printer should be of much higher quality than a
similar PICT/PNTG image.
- A colored EPSF picture will print correctly on a PostScript printer
(assuming it supports color) even though will convert its PICT
resource into a black and white bitmap when previewing.
- Macro packages like
boxedeps.tex
and epsf.tex
can extract the
bounding box information in an EPSF file and position the image automatically.
- Encapsulated PostScript is supported on many other computers.
Some EPSF files, especially those created on other computers or by programs
like MetaPost, do not contain a PICT 256 resource.
When previewing a DVI file that includes such files,
will draw a rectangle showing the bounding box,
along with the name of the file and the message ``no PICT''
near the \special
marker.
If you try to print the DVI file on a non-PostScript printer then
will generate error messages.
When creating a PICT/PNTG file it doesn't really matter where you position
the picture; will convert it to a black and white bitmap,
find the smallest bounding box of all black pixels in the bitmap,
then place the bounding box so that its bottom left corner coincides
with the location of the \special
.
does much the same thing for an EPSF picture; it places the lower left
corner of the bounding box at the location of the \special
.
The only difference is that if the PICT 256 resource is available
(for preview or non-PostScript printing) then makes no attempt to
determine the smallest bounding box of all black pixels in the picture.
This is because the picture's dimensions should match those of the
BoundingBox comment in the data fork
( will warn you if the dimensions differ by more than 3 bp).
allows optional keyword=value
pairs after the file name
in a PICT/PNTG/EPSF \special
.
The keyword can also be terminated by a space.
Here are the currently supported keywords:
scale=
n –
scales a picture by a factor n (n must be > 0.0 and ≤100.0).
hscale=
n –
sets the horizontal scale factor (and alters the aspect ratio).
vscale=
n –
sets the vertical scale factor (and alters the aspect ratio).
width=
bp –
sets the horizontal scale to get a picture at the desired width
(bp is a number > 0.0 and
≤32000.0 in bp units, where 72 bp = 1 in).
If no previous height
keyword has been used then the vertical scale is
set to the new horizontal scale to preserve the aspect ratio.
height=
bp –
sets the vertical scale to get a picture at the desired height.
If no previous width
keyword has been used then the horizontal scale is
set to the new vertical scale to preserve the aspect ratio.
If a particular keyword is used more than once in a single \special
command then the last value is used.
An illegal keyword or value will produce an error message when previewing
or printing. Synonyms exist for most keywords:
epsf
= eps
or epsfile
pict
= pictfile
pntg
= macpaint
hscale
= xscale
vscale
= yscale
width
= wd
height
= ht
Here are some examples of how to use \special
commands:
- To include a picture at ``normal'' size:
\special{pntg=ozicon}
- To halve the size:
\special{pntg=ozicon scale=0.5}
- To double the width:
\special{pntg=ozicon hscale=2}
.
- To set the height to 0.2 in and the width to 2 in:
\special{pntg=ozicon ht=14.4 wd=144}
.
- To set the height to 0.5 in and preserve the aspect ratio:
\special{pntg=ozicon ht=36}
.
The figure on page
of this user guide was created by using
\special{pntg=folders scale=0.72}
to include an extract from a Macintosh screen dump.
The scale value of 0.72 was chosen because it is a multiple of
0.24 = 72/300, where 72 dpi is the resolution of the MacPaint bitmap
and 300 dpi is the resolution of my printer.
This technique can improve the print quality of scaled bitmaps.